﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MsgBrd.aspx.cs" Inherits="MessageBoard_Default" Title="留言板" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
     function check()
     {
          var ckbx = document.getElementById("ctl00_ContentPlaceHolder1_cb_IsAnony");  
          var tbNam = document.getElementById("ctl00_ContentPlaceHolder1_tb_UserName").value;
          var tbCon = document.getElementById("ctl00_ContentPlaceHolder1_tb_Content").value;  
          var divAlert = document.getElementById("ctl00_ContentPlaceHolder1_divAlert");         
          if(!ckbx.checked && tbNam == "" )
          {             
             divAlert.innerHTML = "请输入用户名或选择匿名发表";
             return false;   
          }
          else if(tbCon == "")
          {
             divAlert.innerHTML = "留言不能为空";
             return false;
          }
          return true;                  
     }
</script>
<div class="msg">
<div class="msgheader">
    当前共有<font color="red"><asp:Label ID="lbl_Count" Text="0" runat="server"></asp:Label></font>条留言
</div>
<div style="text-align:center;">
    <asp:Repeater ID="rp_Msgs" runat="server">
        <ItemTemplate>
            <div style="text-align:center">
                <div class="msgtitle">
                    <%#Eval("CreateTime")%>&nbsp&nbsp<%#Eval("UserName")%>&nbsp;&nbsp;<%#Eval("IP")%>
                </div>
                <div class="msgcontent" >
                    <asp:Literal runat="server" ID="Label1" Text='<%#spbtzb.AuthenCtr.Decode(Eval("Content").ToString())%>'
                        Visible="true"></asp:Literal>
                </div>
            </div>
        </ItemTemplate>
        
    </asp:Repeater><div class="buttonlist" id="dvbtn" runat="server">第&nbsp;<asp:Label ID="lbCurPage" runat="server" Text="Label"></asp:Label>&nbsp;页
<asp:Button Text="前一页" ID="btnPreviousPage"  runat="server" OnClick="btnPreviousPage_Click"/>
<asp:Button Text="后一页" ID="btnNextPage"  runat="server" OnClick="btnNextPage_Click"/></div>
</div>
<div class="msgmodel1"></div>
<div class="msgmodel">
<div style="height:37px;">姓名: <asp:TextBox ID="tb_UserName" runat="server"></asp:TextBox>
<asp:CheckBox ID="cb_IsAnony" runat="server" Text="匿名发表" /></div>
<div style="vertical-align:top;"><asp:TextBox ID="tb_Content" TextMode="MultiLine" runat="server" Height="112px" Width="780px"></asp:TextBox>
<%--<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="内容不能为空"
 ControlToValidate="tb_Content" ValidationGroup="vcontent"></asp:RequiredFieldValidator>--%></div>
 <div style="text-align:right; padding-right:25px;">
 <asp:Button ID="btok" runat="server" Text="提交留言" OnClientClick="return check();" OnClick="btok_Click" ValidationGroup="vcontent"/>
 </div><font color="red">
<div id="divAlert" runat="server" style="z-index:1001; height:10px; width:auto;" >
</div></font>
</div>
</div>       
   <script type="text/javascript">
     function browserinfo(){
        var Browser_Name=navigator.appName;
        var Browser_Version=parseFloat(navigator.appVersion);
        var Browser_Agent=navigator.userAgent;
        var Actual_Name;
        var Actual_Version;
        
        if(Browser_Name=="Netscape")
        {
           document.getElementById("content").style.height = "auto";
        }
        else if(Browser_Name=="Microsoft Internet Explorer"){
        }
        else{
            //未知浏览器
            setActiveStyleSheet("Index.css");
        }
    }
    browserinfo();
    </script> 
</asp:Content>

